{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 实验环境\n",
    "* deepin v20 beta  linux 5.3\n",
    "* sqlite数据库 \n",
    "* 数据库软件 DB Broswer for Sqlite，小巧好用，非常推荐 \n",
    "* Python 3.7 \n",
    "* selenium 务必装上相对应的driver，我是Linux chrome83.0.4103.97 \n",
    "* pyqt5\n",
    "* pyechart \n",
    "* 其他的一些工具 QtDesinger\n",
    "* 注意看有没有PyQtWebEngine,在这儿坑过，没有这个显示html会显示空白"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 基本的爬虫代码\n",
    "* 感谢James提供简答易爬的网址"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "from selenium import webdriver"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "* 获取总共确诊人数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "时间 : 截止至2020年06月08日 08:30\n",
      "确诊 : 84630例\n",
      "疑似 : 1776例\n",
      "治愈 : 79857例\n",
      "重症 : 236例\n",
      "死亡 : 4645例\n"
     ]
    }
   ],
   "source": [
    "# 爬取网页地址\n",
    "url = \"http://zhongxinzhiyuan.cn/yiqing_real_time_map.html\"\n",
    "# 使用谷歌浏览器应用程序chromedriver.exe打开网页，需要自己修改chromedriver.exe所在的路径\n",
    "driver = webdriver.Chrome(\"/home/ymy/Documents/pyqt5实战/数据库实验/爬虫数据和database/chromedriver\")\n",
    "#为什么相对位置不行,还没搞清楚\n",
    "driver.get(url)\n",
    "# 根据ID爬取数据函数\n",
    "def getdata(id, id_cn):\n",
    "    try:\n",
    "        driver.find_element_by_id(id)  # F12按键，查到数据的id，爬取时间\n",
    "        print(id_cn,':',driver.find_element_by_id(id).text)\n",
    "    except:\n",
    "        print(id_cn,':','获取失败')\n",
    "\n",
    "dataid = ['timeline','diagnose','suspect','cure','serious','death']\n",
    "dataid_cn = ['时间','确诊','疑似','治愈','重症','死亡']\n",
    "\n",
    "# 开始尝试爬取数据\n",
    "for num in range(len(dataid)):\n",
    "    getdata(dataid[num],dataid_cn[num])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "* 获取国内确证情况"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "663\n",
      "1 香港 53 1106 1049 4\n",
      "2 内蒙古自治区 21 235 213 1\n",
      "3 四川省 17 578 558 3\n",
      "4 广东省 10 1602 1584 8\n",
      "5 上海市 6 677 664 7\n",
      "6 台湾 6 443 430 7\n",
      "7 山东省 5 792 780 7\n",
      "8 陕西省 3 311 305 3\n",
      "9 北京市 2 594 583 9\n",
      "10 福建省 2 359 356 1\n",
      "11 海南省 2 170 162 6\n",
      "12 天津市 1 193 189 3\n",
      "13 湖北省 0 68135 63623 4512\n",
      "14 河南省 0 1276 1254 22\n",
      "15 浙江省 0 1268 1267 1\n",
      "16 湖南省 0 1019 1015 4\n",
      "17 安徽省 0 991 985 6\n",
      "18 黑龙江省 0 947 934 13\n",
      "19 江西省 0 932 931 1\n",
      "20 江苏省 0 653 653 0\n",
      "21 重庆市 0 579 573 6\n",
      "22 河北省 0 328 322 6\n",
      "23 广西壮族自治区 0 254 252 2\n",
      "24 山西省 0 198 198 0\n",
      "25 云南省 0 185 183 2\n",
      "26 吉林省 0 155 153 2\n",
      "27 辽宁省 0 149 147 2\n",
      "28 贵州省 0 147 145 2\n",
      "29 甘肃省 0 139 137 2\n",
      "30 新疆维吾尔自治区 0 76 73 3\n",
      "31 宁夏回族自治区 0 75 75 0\n",
      "32 澳门 0 45 45 0\n",
      "33 青海省 0 18 18 0\n",
      "34 西藏自治区 0 1 1 0\n"
     ]
    }
   ],
   "source": [
    "def getdata_1(id):\n",
    "    try:\n",
    "        driver.find_element_by_id(id)\n",
    "        #print(driver.find_element_by_id(id).text)\n",
    "        text1 = driver.find_element_by_id(id).text\n",
    "        print(len(text1))\n",
    "        print(text1)\n",
    "        return text1\n",
    "    except:\n",
    "        print(id_cn,':','获取失败')\n",
    "\n",
    "dataid = ['table-provience']\n",
    "\n",
    "# 开始尝试爬取数据\n",
    "for num in range(len(dataid)):\n",
    "    text_china = getdata_1(dataid[num])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "* 获取全球确诊情况"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "5168\n",
      "北美洲 美国 1309892 1920552 500849 109811\n",
      "南美洲 巴西 338366 676494 302084 36044\n",
      "欧洲 英国 243864 284868 539 40465\n",
      "欧洲 俄罗斯 235083 467673 226731 5859\n",
      "亚洲 印度 120406 246628 119293 6929\n",
      "南美洲 秘鲁 103726 191758 82731 5301\n",
      "南美洲 智利 81258 127745 44946 1541\n",
      "欧洲 西班牙 63799 241310 150376 27135\n",
      "亚洲 巴基斯坦 63476 98943 33465 2002\n",
      "欧洲 法国 53686 153634 70806 29142\n",
      "亚洲 孟加拉国 50958 65769 13923 888\n",
      "欧洲 意大利 35877 234801 165078 33846\n",
      "欧洲 瑞典 35185 44845 4971 4689\n",
      "南美洲 厄瓜多尔 34514 42106 4000 3592\n",
      "北美洲 加拿大 33670 95057 53614 7773\n",
      "欧洲 比利时 33340 59226 16291 9595\n",
      "欧洲 荷兰 29779 47574 11782 6013\n",
      "亚洲 土耳其 29227 169218 135322 4669\n",
      "亚洲 伊朗 29149 171789 134349 8291\n",
      "亚洲 沙特阿拉伯 28385 101914 72817 712\n",
      "欧洲 白俄罗斯 24714 48630 23647 269\n",
      "亚洲 卡塔尔 24398 68790 44338 54\n",
      "非洲 埃及 22876 32612 8538 1198\n",
      "南美洲 哥伦比亚 22440 38027 14382 1205\n",
      "非洲 南非 20763 45973 24258 952\n",
      "亚洲 印度尼西亚 18837 31186 10498 1851\n",
      "北美洲 墨西哥 18564 113619 81544 13511\n",
      "亚洲 阿富汗 17394 19551 1830 327\n",
      "亚洲 阿联酋 16726 38808 21806 276\n",
      "亚洲 菲律宾 16362 21895 4530 1003\n",
      "南美洲 阿根廷 14317 21037 6088 632\n",
      "欧洲 乌克兰 14157 26999 12054 788\n",
      "亚洲 阿曼 13356 16882 3451 75\n",
      "亚洲 新加坡 13326 37910 24559 25\n",
      "欧洲 葡萄牙 12219 34693 20995 1479\n",
      "南美洲 玻利维亚 11671 12245 159 415\n",
      "欧洲 波兰 11625 25419 12641 1153\n",
      "亚洲 科威特 11379 31848 20205 264\n",
      "亚洲 亚美尼亚 8916 13130 4014 200\n",
      "非洲 尼日利亚 8065 12233 3826 342\n",
      "北美洲 多米尼加 6765 19220 11919 536\n",
      "欧洲 德国 6211 183979 169100 8668\n",
      "北美洲 危地马拉 5996 6154 0 158\n",
      "亚洲 伊拉克 5876 11098 4904 318\n",
      "非洲 加纳 5871 9462 3547 44\n",
      "北美洲 洪都拉斯 5637 5880 0 243\n",
      "亚洲 哈萨克斯坦 5506 12694 7135 53\n",
      "北美洲 巴拿马 5500 16004 10118 386\n",
      "亚洲 巴林 5270 14763 9468 25\n",
      "非洲 喀麦隆 5191 7392 1996 205\n",
      "欧洲 罗马尼亚 4515 20479 14638 1326\n",
      "北美洲 波多黎各 4479 4620 0 141\n",
      "非洲 苏丹 3708 6081 2014 359\n",
      "欧洲 摩尔多瓦 3684 9247 5240 323\n",
      "非洲 刚果（金） 3393 4015 537 85\n",
      "亚洲 阿塞拜疆 3131 7239 4024 84\n",
      "亚洲 尼泊尔 2968 3448 467 13\n",
      "北美洲 萨尔瓦多 2796 2849 0 53\n",
      "非洲 阿尔及利亚 2721 10050 6631 698\n",
      "北美洲 海地 2590 2640 0 50\n",
      "亚洲 以色列 2422 17783 15064 297\n",
      "非洲 吉布提 2412 4123 1685 26\n",
      "欧洲 捷克 2318 9529 6884 327\n",
      "非洲 加蓬 2247 3101 833 21\n",
      "南美洲 委内瑞拉 2067 2087 0 20\n",
      "非洲 马约特 2054 2079 0 25\n",
      "非洲 肯尼亚 1931 2767 752 84\n",
      "非洲 科特迪瓦 1850 3431 1545 36\n",
      "亚洲 日本 1842 17164 14406 916\n",
      "亚洲 塔吉克斯坦 1831 4370 2491 48\n",
      "欧洲 芬兰 1819 6941 4800 322\n",
      "欧洲 保加利亚 1781 2668 727 160\n",
      "非洲 索马里 1719 2204 406 79\n",
      "欧洲 丹麦 1694 11924 9643 587\n",
      "非洲 塞内加尔 1690 4249 2512 47\n",
      "非洲 埃塞俄比亚 1633 1934 281 20\n",
      "亚洲 马来西亚 1531 8322 6674 117\n",
      "非洲 中非共和国 1528 1570 37 5\n",
      "北美洲 古巴 1525 2133 525 83\n",
      "非洲 几内亚 1370 4060 2667 23\n",
      "亚洲 乌兹别克斯坦 1370 4022 2636 16\n",
      "非洲 南苏丹 1297 1317 6 14\n",
      "欧洲 希腊 1285 2937 1473 179\n",
      "北美洲 尼加拉瓜 1263 1309 0 46\n",
      "非洲 几内亚比绍 1203 1368 153 12\n",
      "北美洲 哥斯达黎加 1184 1194 0 10\n",
      "欧洲 匈牙利 1183 4008 2279 546\n",
      "欧洲 奥地利 1180 16803 14951 672\n",
      "亚洲 马尔代夫 1159 1883 717 7\n",
      "欧洲 北马其顿 1124 2915 1640 151\n",
      "亚洲 吉尔吉斯斯坦 972 1974 980 22\n",
      "亚洲 韩国 951 11776 10552 273\n",
      "亚洲 斯里兰卡 951 1801 839 11\n",
      "南美洲 巴拉圭 878 1087 198 11\n",
      "非洲 赤道几内亚 866 1043 165 12\n",
      "欧洲 爱尔兰 807 25183 22698 1678\n",
      "非洲 马达加斯加 806 1026 212 8\n",
      "非洲 毛里塔尼亚 771 883 69 43\n",
      "非洲 乍得 768 836 0 68\n",
      "欧洲 瑞士 678 30883 28545 1660\n",
      "欧洲 塞尔维亚 678 12883 11927 278\n",
      "非洲 塞拉利昂 677 929 205 47\n",
      "欧洲 圣马力诺 651 695 2 42\n",
      "非洲 摩洛哥 646 8132 7278 208\n",
      "非洲 乌干达 607 686 79 0\n",
      "欧洲 拉脱维亚 593 1082 464 25\n",
      "南美洲 法属圭亚那 588 589 0 1\n",
      "非洲 马里 582 1485 816 87\n",
      "北美洲 牙买加 581 591 0 10\n",
      "欧洲 立陶宛 574 1694 1049 71\n",
      "欧洲 爱沙尼亚 566 1910 1275 69\n",
      "亚洲 黎巴嫩 553 1312 731 28\n",
      "非洲 佛得角 487 536 44 5\n",
      "欧洲 波黑 484 2610 1968 158\n",
      "欧洲 阿尔巴尼亚 484 1232 714 34\n",
      "非洲 留尼旺 479 480 0 1\n",
      "大洋洲 澳大利亚 460 7255 6693 102\n",
      "非洲 刚果（布） 440 639 179 20\n",
      "亚洲 塞浦路斯 430 960 504 26\n",
      "非洲 圣多美和普林西比 378 458 68 12\n",
      "非洲 多哥 365 485 107 13\n",
      "非洲 马拉维 350 409 55 4\n",
      "亚洲 也门共和国 335 473 26 112\n",
      "欧洲 安道尔 329 852 472 51\n",
      "非洲 赞比亚共和国 325 1111 779 7\n",
      "非洲 坦桑尼亚 321 509 167 21\n",
      "欧洲 马恩岛 312 336 0 24\n",
      "非洲 斯威士兰 289 305 13 3\n",
      "欧洲 泽西岛 279 309 0 30\n",
      "非洲 贝宁 274 339 62 3\n",
      "欧洲 挪威 273 8510 7999 238\n",
      "亚洲 巴勒斯坦 261 643 377 5\n",
      "非洲 莫桑比克 252 352 98 2\n",
      "欧洲 马耳他 246 622 367 9\n",
      "非洲 卢旺达 240 420 178 2\n",
      "欧洲 根西岛 239 252 0 13\n",
      "非洲 津巴布韦 228 265 33 4\n",
      "非洲 利比里亚 219 334 85 30\n",
      "亚洲 约旦 204 784 571 9\n",
      "欧洲 法罗群岛 187 187 0 0\n",
      "北美洲 马提尼克 186 200 0 14\n",
      "非洲 布基纳法索 177 885 655 53\n",
      "欧洲 直布罗陀 173 174 0 1\n",
      "非洲 尼日尔 167 966 734 65\n",
      "亚洲 蒙古 167 191 24 0\n",
      "大洋洲 关岛 166 171 0 5\n",
      "亚洲 格鲁吉亚 161 808 634 13\n",
      "非洲 利比亚 159 239 75 5\n",
      "北美洲 开曼群岛 158 160 0 2\n",
      "北美洲 瓜德罗普岛 150 164 0 14\n",
      "欧洲 卢森堡 133 4032 3789 110\n",
      "北美洲 百慕大 132 141 0 9\n",
      "欧洲 斯洛伐克 130 1526 1368 28\n",
      "亚洲 中国 128 84630 79857 4645\n",
      "其他 钻石公主号邮轮 125 712 574 13\n",
      "欧洲 克罗地亚 117 2247 2027 103\n",
      "南美洲 圭亚那 114 153 27 12\n",
      "南美洲 乌拉圭 111 832 698 23\n",
      "北美洲 特立尼达和多巴哥 109 117 0 8\n",
      "亚洲 缅甸 100 236 130 6\n",
      "北美洲 阿鲁巴 98 101 0 3\n",
      "欧洲 摩纳哥 92 98 3 3\n",
      "北美洲 巴哈马 91 102 0 11\n",
      "大洋洲 法属波利尼西亚 89 89 0 0\n",
      "北美洲 巴巴多斯 85 92 0 7\n",
      "亚洲 泰国 82 3112 2972 58\n",
      "亚洲 叙利亚 77 124 41 6\n",
      "南美洲 苏里南 75 82 6 1\n",
      "非洲 突尼斯 74 1087 964 49\n",
      "欧洲 斯洛文尼亚 66 1509 1335 108\n",
      "非洲 安哥拉 65 86 17 4\n",
      "北美洲 美属维尔京群岛 65 71 0 6\n",
      "北美洲 荷属圣马丁 63 78 0 15\n",
      "亚洲 越南 62 329 267 0\n",
      "非洲 科摩罗 60 62 0 2\n",
      "非洲 布隆迪共和国 58 63 4 1\n",
      "亚洲 不丹 48 48 0 0\n",
      "欧洲 冰岛 41 1806 1755 10\n",
      "非洲 博茨瓦纳 39 40 0 1\n",
      "北美洲 圣马丁岛 38 41 0 3\n",
      "欧洲 列支敦士登 27 83 55 1\n",
      "北美洲 圣文森特和格林纳丁斯 26 26 0 0\n",
      "大洋洲 北马里亚纳群岛联邦 24 26 0 2\n",
      "亚洲 东帝汶 24 24 0 0\n",
      "非洲 冈比亚 23 26 2 1\n",
      "北美洲 格林那达 23 23 0 0\n",
      "非洲 纳米比亚 22 25 3 0\n",
      "北美洲 安提瓜和巴布达 22 25 0 3\n",
      "北美洲 库拉索岛 20 21 0 1\n",
      "大洋洲 新喀里多尼亚 20 20 0 0\n",
      "北美洲 圣卢西亚 19 19 0 0\n",
      "亚洲 老挝 19 19 0 0\n",
      "大洋洲 斐济 18 18 0 0\n",
      "北美洲 伯利兹 16 18 0 2\n",
      "北美洲 多米尼克 16 16 0 0\n",
      "北美洲 圣其茨和尼维斯 15 15 0 0\n",
      "北美洲 格陵兰 13 13 0 0\n",
      "南美洲 福克兰群岛 13 13 0 0\n",
      "欧洲 梵蒂冈 12 12 0 0\n",
      "北美洲 特克斯和凯科斯群岛 11 12 0 1\n",
      "非洲 塞舌尔 11 11 0 0\n",
      "北美洲 蒙特塞拉特 10 11 0 1\n",
      "亚洲 文莱 8 141 131 2\n",
      "大洋洲 巴布亚新几内亚 8 8 0 0\n",
      "北美洲 英属维尔京群岛 7 8 0 1\n",
      "南美洲 荷兰加勒比地区 7 7 0 0\n",
      "北美洲 圣巴泰勒米岛 6 6 0 0\n",
      "非洲 毛里求斯 5 337 322 10\n",
      "非洲 莱索托 4 4 0 0\n",
      "亚洲 柬埔寨 3 125 122 0\n",
      "北美洲 安圭拉 3 3 0 0\n",
      "非洲 厄立特里亚 2 41 39 0\n",
      "北美洲 圣皮埃尔和密克隆群岛 1 1 0 0\n",
      "欧洲 黑山 0 324 315 9\n",
      "大洋洲 新西兰 -215 1154 1347 22\n"
     ]
    }
   ],
   "source": [
    "dataid = ['table-tr']\n",
    "\n",
    "# 开始尝试爬取数据\n",
    "for num in range(len(dataid)):\n",
    "    text_global = getdata_1(dataid[num])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import pandas as pd\n",
    "import json\n",
    "from pandas import json_normalize\n",
    "import pyecharts as pe\n",
    "from collections import Counter"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 桌面环境中加入html显示疫情地图，例子就像下面一样，在软件中也存了两张图，pyechart实现，具体见代码"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min', 'china':'https://assets.pyecharts.org/assets/maps/china'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"b9663f9c24a64abfb19a292a37a65a9d\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts', 'china'], function(echarts) {\n",
       "                var chart_b9663f9c24a64abfb19a292a37a65a9d = echarts.init(\n",
       "                    document.getElementById('b9663f9c24a64abfb19a292a37a65a9d'), 'white', {renderer: 'canvas'});\n",
       "                var option_b9663f9c24a64abfb19a292a37a65a9d = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"scatter\",\n",
       "            \"name\": \"geo\",\n",
       "            \"coordinateSystem\": \"geo\",\n",
       "            \"symbolSize\": 12,\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"\\u5e7f\\u4e1c\",\n",
       "                    \"value\": [\n",
       "                        113.26653,\n",
       "                        23.132191,\n",
       "                        76\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5317\\u4eac\",\n",
       "                    \"value\": [\n",
       "                        116.407526,\n",
       "                        39.90403,\n",
       "                        142\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u4e0a\\u6d77\",\n",
       "                    \"value\": [\n",
       "                        121.473701,\n",
       "                        31.230416,\n",
       "                        146\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6c5f\\u897f\",\n",
       "                    \"value\": [\n",
       "                        115.909228,\n",
       "                        28.675696,\n",
       "                        28\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6e56\\u5357\",\n",
       "                    \"value\": [\n",
       "                        112.98381,\n",
       "                        28.112444,\n",
       "                        124\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6d59\\u6c5f\",\n",
       "                    \"value\": [\n",
       "                        120.152791,\n",
       "                        30.267446,\n",
       "                        60\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6c5f\\u82cf\",\n",
       "                    \"value\": [\n",
       "                        118.763232,\n",
       "                        32.061707,\n",
       "                        22\n",
       "                    ]\n",
       "                }\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"show\": false,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"rippleEffect\": {\n",
       "                \"show\": true,\n",
       "                \"brushType\": \"stroke\",\n",
       "                \"scale\": 2.5,\n",
       "                \"period\": 4\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"geo\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"geo\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"formatter\": function (params) {        return params.name + ' : ' + params.value[2];    },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"Pyechart-\\u57fa\\u672c\\u793a\\u4f8b\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ],\n",
       "    \"visualMap\": {\n",
       "        \"show\": true,\n",
       "        \"type\": \"piecewise\",\n",
       "        \"min\": 0,\n",
       "        \"max\": 100,\n",
       "        \"inRange\": {\n",
       "            \"color\": [\n",
       "                \"#50a3ba\",\n",
       "                \"#eac763\",\n",
       "                \"#d94e5d\"\n",
       "            ]\n",
       "        },\n",
       "        \"calculable\": true,\n",
       "        \"inverse\": false,\n",
       "        \"splitNumber\": 5,\n",
       "        \"orient\": \"vertical\",\n",
       "        \"showLabel\": true,\n",
       "        \"itemWidth\": 20,\n",
       "        \"itemHeight\": 14,\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"geo\": {\n",
       "        \"map\": \"china\",\n",
       "        \"roam\": true,\n",
       "        \"emphasis\": {}\n",
       "    }\n",
       "};\n",
       "                chart_b9663f9c24a64abfb19a292a37a65a9d.setOption(option_b9663f9c24a64abfb19a292a37a65a9d);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x7f544cf93550>"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pyecharts.faker import Faker\n",
    "from pyecharts import options as opts\n",
    "from pyecharts.charts import Geo\n",
    "from pyecharts.globals import ChartType, SymbolType\n",
    "\n",
    "\n",
    "g0 = Geo()\n",
    "g0.add_schema(maptype=\"china\")\n",
    "g0.add(\"geo\", [list(z) for z in zip(Faker.provinces, Faker.values())])\n",
    "g0.set_series_opts(label_opts=opts.LabelOpts(is_show=False))#去掉标识\n",
    "g0.set_global_opts(\n",
    "            visualmap_opts=opts.VisualMapOpts(is_piecewise=True),#显示坐下角的颜色控制\n",
    "            title_opts=opts.TitleOpts(title=\"Pyechart-基本示例\"),\n",
    "        )\n",
    "g0.render_notebook()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 先对数据进行简单的处理"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['1 香港 53 1106 1049 4',\n",
       " '2 内蒙古自治区 21 235 213 1',\n",
       " '3 四川省 17 578 558 3',\n",
       " '4 广东省 10 1602 1584 8',\n",
       " '5 上海市 6 677 664 7',\n",
       " '6 台湾 6 443 430 7',\n",
       " '7 山东省 5 792 780 7',\n",
       " '8 陕西省 3 311 305 3',\n",
       " '9 北京市 2 594 583 9',\n",
       " '10 福建省 2 359 356 1',\n",
       " '11 海南省 2 170 162 6',\n",
       " '12 天津市 1 193 189 3',\n",
       " '13 湖北省 0 68135 63623 4512',\n",
       " '14 河南省 0 1276 1254 22',\n",
       " '15 浙江省 0 1268 1267 1',\n",
       " '16 湖南省 0 1019 1015 4',\n",
       " '17 安徽省 0 991 985 6',\n",
       " '18 黑龙江省 0 947 934 13',\n",
       " '19 江西省 0 932 931 1',\n",
       " '20 江苏省 0 653 653 0',\n",
       " '21 重庆市 0 579 573 6',\n",
       " '22 河北省 0 328 322 6',\n",
       " '23 广西壮族自治区 0 254 252 2',\n",
       " '24 山西省 0 198 198 0',\n",
       " '25 云南省 0 185 183 2',\n",
       " '26 吉林省 0 155 153 2',\n",
       " '27 辽宁省 0 149 147 2',\n",
       " '28 贵州省 0 147 145 2',\n",
       " '29 甘肃省 0 139 137 2',\n",
       " '30 新疆维吾尔自治区 0 76 73 3',\n",
       " '31 宁夏回族自治区 0 75 75 0',\n",
       " '32 澳门 0 45 45 0',\n",
       " '33 青海省 0 18 18 0',\n",
       " '34 西藏自治区 0 1 1 0']"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#先对数据进行简单的处理\n",
    "temp1 = text_china.split(\"\\n\")\n",
    "temp1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "#同上\n",
    "temp_China =[]\n",
    "for i in temp1:\n",
    "    temp_China.append(i.split())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[['1', '香港', '53', '1106', '1049', '4'],\n",
       " ['2', '内蒙古自治区', '21', '235', '213', '1'],\n",
       " ['3', '四川省', '17', '578', '558', '3'],\n",
       " ['4', '广东省', '10', '1602', '1584', '8'],\n",
       " ['5', '上海市', '6', '677', '664', '7'],\n",
       " ['6', '台湾', '6', '443', '430', '7'],\n",
       " ['7', '山东省', '5', '792', '780', '7'],\n",
       " ['8', '陕西省', '3', '311', '305', '3'],\n",
       " ['9', '北京市', '2', '594', '583', '9'],\n",
       " ['10', '福建省', '2', '359', '356', '1'],\n",
       " ['11', '海南省', '2', '170', '162', '6'],\n",
       " ['12', '天津市', '1', '193', '189', '3'],\n",
       " ['13', '湖北省', '0', '68135', '63623', '4512'],\n",
       " ['14', '河南省', '0', '1276', '1254', '22'],\n",
       " ['15', '浙江省', '0', '1268', '1267', '1'],\n",
       " ['16', '湖南省', '0', '1019', '1015', '4'],\n",
       " ['17', '安徽省', '0', '991', '985', '6'],\n",
       " ['18', '黑龙江省', '0', '947', '934', '13'],\n",
       " ['19', '江西省', '0', '932', '931', '1'],\n",
       " ['20', '江苏省', '0', '653', '653', '0'],\n",
       " ['21', '重庆市', '0', '579', '573', '6'],\n",
       " ['22', '河北省', '0', '328', '322', '6'],\n",
       " ['23', '广西壮族自治区', '0', '254', '252', '2'],\n",
       " ['24', '山西省', '0', '198', '198', '0'],\n",
       " ['25', '云南省', '0', '185', '183', '2'],\n",
       " ['26', '吉林省', '0', '155', '153', '2'],\n",
       " ['27', '辽宁省', '0', '149', '147', '2'],\n",
       " ['28', '贵州省', '0', '147', '145', '2'],\n",
       " ['29', '甘肃省', '0', '139', '137', '2'],\n",
       " ['30', '新疆维吾尔自治区', '0', '76', '73', '3'],\n",
       " ['31', '宁夏回族自治区', '0', '75', '75', '0'],\n",
       " ['32', '澳门', '0', '45', '45', '0'],\n",
       " ['33', '青海省', '0', '18', '18', '0'],\n",
       " ['34', '西藏自治区', '0', '1', '1', '0']]"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "temp_China"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 利用pandas处理数据，"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>省份</th>\n",
       "      <th>现存确诊</th>\n",
       "      <th>累计确诊</th>\n",
       "      <th>治愈</th>\n",
       "      <th>死亡</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>香港</td>\n",
       "      <td>53</td>\n",
       "      <td>1106</td>\n",
       "      <td>1049</td>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>内蒙古自治区</td>\n",
       "      <td>21</td>\n",
       "      <td>235</td>\n",
       "      <td>213</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>四川省</td>\n",
       "      <td>17</td>\n",
       "      <td>578</td>\n",
       "      <td>558</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>广东省</td>\n",
       "      <td>10</td>\n",
       "      <td>1602</td>\n",
       "      <td>1584</td>\n",
       "      <td>8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>上海市</td>\n",
       "      <td>6</td>\n",
       "      <td>677</td>\n",
       "      <td>664</td>\n",
       "      <td>7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>台湾</td>\n",
       "      <td>6</td>\n",
       "      <td>443</td>\n",
       "      <td>430</td>\n",
       "      <td>7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>山东省</td>\n",
       "      <td>5</td>\n",
       "      <td>792</td>\n",
       "      <td>780</td>\n",
       "      <td>7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>陕西省</td>\n",
       "      <td>3</td>\n",
       "      <td>311</td>\n",
       "      <td>305</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>北京市</td>\n",
       "      <td>2</td>\n",
       "      <td>594</td>\n",
       "      <td>583</td>\n",
       "      <td>9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>福建省</td>\n",
       "      <td>2</td>\n",
       "      <td>359</td>\n",
       "      <td>356</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>海南省</td>\n",
       "      <td>2</td>\n",
       "      <td>170</td>\n",
       "      <td>162</td>\n",
       "      <td>6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>天津市</td>\n",
       "      <td>1</td>\n",
       "      <td>193</td>\n",
       "      <td>189</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>湖北省</td>\n",
       "      <td>0</td>\n",
       "      <td>68135</td>\n",
       "      <td>63623</td>\n",
       "      <td>4512</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>河南省</td>\n",
       "      <td>0</td>\n",
       "      <td>1276</td>\n",
       "      <td>1254</td>\n",
       "      <td>22</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>浙江省</td>\n",
       "      <td>0</td>\n",
       "      <td>1268</td>\n",
       "      <td>1267</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>湖南省</td>\n",
       "      <td>0</td>\n",
       "      <td>1019</td>\n",
       "      <td>1015</td>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>安徽省</td>\n",
       "      <td>0</td>\n",
       "      <td>991</td>\n",
       "      <td>985</td>\n",
       "      <td>6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>黑龙江省</td>\n",
       "      <td>0</td>\n",
       "      <td>947</td>\n",
       "      <td>934</td>\n",
       "      <td>13</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>江西省</td>\n",
       "      <td>0</td>\n",
       "      <td>932</td>\n",
       "      <td>931</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>江苏省</td>\n",
       "      <td>0</td>\n",
       "      <td>653</td>\n",
       "      <td>653</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>重庆市</td>\n",
       "      <td>0</td>\n",
       "      <td>579</td>\n",
       "      <td>573</td>\n",
       "      <td>6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>河北省</td>\n",
       "      <td>0</td>\n",
       "      <td>328</td>\n",
       "      <td>322</td>\n",
       "      <td>6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>广西壮族自治区</td>\n",
       "      <td>0</td>\n",
       "      <td>254</td>\n",
       "      <td>252</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>山西省</td>\n",
       "      <td>0</td>\n",
       "      <td>198</td>\n",
       "      <td>198</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>云南省</td>\n",
       "      <td>0</td>\n",
       "      <td>185</td>\n",
       "      <td>183</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>吉林省</td>\n",
       "      <td>0</td>\n",
       "      <td>155</td>\n",
       "      <td>153</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>辽宁省</td>\n",
       "      <td>0</td>\n",
       "      <td>149</td>\n",
       "      <td>147</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>贵州省</td>\n",
       "      <td>0</td>\n",
       "      <td>147</td>\n",
       "      <td>145</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>甘肃省</td>\n",
       "      <td>0</td>\n",
       "      <td>139</td>\n",
       "      <td>137</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>新疆维吾尔自治区</td>\n",
       "      <td>0</td>\n",
       "      <td>76</td>\n",
       "      <td>73</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>30</th>\n",
       "      <td>宁夏回族自治区</td>\n",
       "      <td>0</td>\n",
       "      <td>75</td>\n",
       "      <td>75</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>31</th>\n",
       "      <td>澳门</td>\n",
       "      <td>0</td>\n",
       "      <td>45</td>\n",
       "      <td>45</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32</th>\n",
       "      <td>青海省</td>\n",
       "      <td>0</td>\n",
       "      <td>18</td>\n",
       "      <td>18</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>33</th>\n",
       "      <td>西藏自治区</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          省份 现存确诊   累计确诊     治愈    死亡\n",
       "0         香港   53   1106   1049     4\n",
       "1     内蒙古自治区   21    235    213     1\n",
       "2        四川省   17    578    558     3\n",
       "3        广东省   10   1602   1584     8\n",
       "4        上海市    6    677    664     7\n",
       "5         台湾    6    443    430     7\n",
       "6        山东省    5    792    780     7\n",
       "7        陕西省    3    311    305     3\n",
       "8        北京市    2    594    583     9\n",
       "9        福建省    2    359    356     1\n",
       "10       海南省    2    170    162     6\n",
       "11       天津市    1    193    189     3\n",
       "12       湖北省    0  68135  63623  4512\n",
       "13       河南省    0   1276   1254    22\n",
       "14       浙江省    0   1268   1267     1\n",
       "15       湖南省    0   1019   1015     4\n",
       "16       安徽省    0    991    985     6\n",
       "17      黑龙江省    0    947    934    13\n",
       "18       江西省    0    932    931     1\n",
       "19       江苏省    0    653    653     0\n",
       "20       重庆市    0    579    573     6\n",
       "21       河北省    0    328    322     6\n",
       "22   广西壮族自治区    0    254    252     2\n",
       "23       山西省    0    198    198     0\n",
       "24       云南省    0    185    183     2\n",
       "25       吉林省    0    155    153     2\n",
       "26       辽宁省    0    149    147     2\n",
       "27       贵州省    0    147    145     2\n",
       "28       甘肃省    0    139    137     2\n",
       "29  新疆维吾尔自治区    0     76     73     3\n",
       "30   宁夏回族自治区    0     75     75     0\n",
       "31        澳门    0     45     45     0\n",
       "32       青海省    0     18     18     0\n",
       "33     西藏自治区    0      1      1     0"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a=pd.DataFrame(temp_China,columns = [\"序号\",'省份','现存确诊','累计确诊','治愈','死亡'] )\n",
    "China = a.iloc[:,1:]\n",
    "China"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[['北美洲', '美国', '1309892', '1920552', '500849', '109811'],\n",
       " ['南美洲', '巴西', '338366', '676494', '302084', '36044'],\n",
       " ['欧洲', '英国', '243864', '284868', '539', '40465'],\n",
       " ['欧洲', '俄罗斯', '235083', '467673', '226731', '5859'],\n",
       " ['亚洲', '印度', '120406', '246628', '119293', '6929'],\n",
       " ['南美洲', '秘鲁', '103726', '191758', '82731', '5301'],\n",
       " ['南美洲', '智利', '81258', '127745', '44946', '1541'],\n",
       " ['欧洲', '西班牙', '63799', '241310', '150376', '27135'],\n",
       " ['亚洲', '巴基斯坦', '63476', '98943', '33465', '2002'],\n",
       " ['欧洲', '法国', '53686', '153634', '70806', '29142'],\n",
       " ['亚洲', '孟加拉国', '50958', '65769', '13923', '888'],\n",
       " ['欧洲', '意大利', '35877', '234801', '165078', '33846'],\n",
       " ['欧洲', '瑞典', '35185', '44845', '4971', '4689'],\n",
       " ['南美洲', '厄瓜多尔', '34514', '42106', '4000', '3592'],\n",
       " ['北美洲', '加拿大', '33670', '95057', '53614', '7773'],\n",
       " ['欧洲', '比利时', '33340', '59226', '16291', '9595'],\n",
       " ['欧洲', '荷兰', '29779', '47574', '11782', '6013'],\n",
       " ['亚洲', '土耳其', '29227', '169218', '135322', '4669'],\n",
       " ['亚洲', '伊朗', '29149', '171789', '134349', '8291'],\n",
       " ['亚洲', '沙特阿拉伯', '28385', '101914', '72817', '712'],\n",
       " ['欧洲', '白俄罗斯', '24714', '48630', '23647', '269'],\n",
       " ['亚洲', '卡塔尔', '24398', '68790', '44338', '54'],\n",
       " ['非洲', '埃及', '22876', '32612', '8538', '1198'],\n",
       " ['南美洲', '哥伦比亚', '22440', '38027', '14382', '1205'],\n",
       " ['非洲', '南非', '20763', '45973', '24258', '952'],\n",
       " ['亚洲', '印度尼西亚', '18837', '31186', '10498', '1851'],\n",
       " ['北美洲', '墨西哥', '18564', '113619', '81544', '13511'],\n",
       " ['亚洲', '阿富汗', '17394', '19551', '1830', '327'],\n",
       " ['亚洲', '阿联酋', '16726', '38808', '21806', '276'],\n",
       " ['亚洲', '菲律宾', '16362', '21895', '4530', '1003'],\n",
       " ['南美洲', '阿根廷', '14317', '21037', '6088', '632'],\n",
       " ['欧洲', '乌克兰', '14157', '26999', '12054', '788'],\n",
       " ['亚洲', '阿曼', '13356', '16882', '3451', '75'],\n",
       " ['亚洲', '新加坡', '13326', '37910', '24559', '25'],\n",
       " ['欧洲', '葡萄牙', '12219', '34693', '20995', '1479'],\n",
       " ['南美洲', '玻利维亚', '11671', '12245', '159', '415'],\n",
       " ['欧洲', '波兰', '11625', '25419', '12641', '1153'],\n",
       " ['亚洲', '科威特', '11379', '31848', '20205', '264'],\n",
       " ['亚洲', '亚美尼亚', '8916', '13130', '4014', '200'],\n",
       " ['非洲', '尼日利亚', '8065', '12233', '3826', '342'],\n",
       " ['北美洲', '多米尼加', '6765', '19220', '11919', '536'],\n",
       " ['欧洲', '德国', '6211', '183979', '169100', '8668'],\n",
       " ['北美洲', '危地马拉', '5996', '6154', '0', '158'],\n",
       " ['亚洲', '伊拉克', '5876', '11098', '4904', '318'],\n",
       " ['非洲', '加纳', '5871', '9462', '3547', '44'],\n",
       " ['北美洲', '洪都拉斯', '5637', '5880', '0', '243'],\n",
       " ['亚洲', '哈萨克斯坦', '5506', '12694', '7135', '53'],\n",
       " ['北美洲', '巴拿马', '5500', '16004', '10118', '386'],\n",
       " ['亚洲', '巴林', '5270', '14763', '9468', '25'],\n",
       " ['非洲', '喀麦隆', '5191', '7392', '1996', '205'],\n",
       " ['欧洲', '罗马尼亚', '4515', '20479', '14638', '1326'],\n",
       " ['北美洲', '波多黎各', '4479', '4620', '0', '141'],\n",
       " ['非洲', '苏丹', '3708', '6081', '2014', '359'],\n",
       " ['欧洲', '摩尔多瓦', '3684', '9247', '5240', '323'],\n",
       " ['非洲', '刚果（金）', '3393', '4015', '537', '85'],\n",
       " ['亚洲', '阿塞拜疆', '3131', '7239', '4024', '84'],\n",
       " ['亚洲', '尼泊尔', '2968', '3448', '467', '13'],\n",
       " ['北美洲', '萨尔瓦多', '2796', '2849', '0', '53'],\n",
       " ['非洲', '阿尔及利亚', '2721', '10050', '6631', '698'],\n",
       " ['北美洲', '海地', '2590', '2640', '0', '50'],\n",
       " ['亚洲', '以色列', '2422', '17783', '15064', '297'],\n",
       " ['非洲', '吉布提', '2412', '4123', '1685', '26'],\n",
       " ['欧洲', '捷克', '2318', '9529', '6884', '327'],\n",
       " ['非洲', '加蓬', '2247', '3101', '833', '21'],\n",
       " ['南美洲', '委内瑞拉', '2067', '2087', '0', '20'],\n",
       " ['非洲', '马约特', '2054', '2079', '0', '25'],\n",
       " ['非洲', '肯尼亚', '1931', '2767', '752', '84'],\n",
       " ['非洲', '科特迪瓦', '1850', '3431', '1545', '36'],\n",
       " ['亚洲', '日本', '1842', '17164', '14406', '916'],\n",
       " ['亚洲', '塔吉克斯坦', '1831', '4370', '2491', '48'],\n",
       " ['欧洲', '芬兰', '1819', '6941', '4800', '322'],\n",
       " ['欧洲', '保加利亚', '1781', '2668', '727', '160'],\n",
       " ['非洲', '索马里', '1719', '2204', '406', '79'],\n",
       " ['欧洲', '丹麦', '1694', '11924', '9643', '587'],\n",
       " ['非洲', '塞内加尔', '1690', '4249', '2512', '47'],\n",
       " ['非洲', '埃塞俄比亚', '1633', '1934', '281', '20'],\n",
       " ['亚洲', '马来西亚', '1531', '8322', '6674', '117'],\n",
       " ['非洲', '中非共和国', '1528', '1570', '37', '5'],\n",
       " ['北美洲', '古巴', '1525', '2133', '525', '83'],\n",
       " ['非洲', '几内亚', '1370', '4060', '2667', '23'],\n",
       " ['亚洲', '乌兹别克斯坦', '1370', '4022', '2636', '16'],\n",
       " ['非洲', '南苏丹', '1297', '1317', '6', '14'],\n",
       " ['欧洲', '希腊', '1285', '2937', '1473', '179'],\n",
       " ['北美洲', '尼加拉瓜', '1263', '1309', '0', '46'],\n",
       " ['非洲', '几内亚比绍', '1203', '1368', '153', '12'],\n",
       " ['北美洲', '哥斯达黎加', '1184', '1194', '0', '10'],\n",
       " ['欧洲', '匈牙利', '1183', '4008', '2279', '546'],\n",
       " ['欧洲', '奥地利', '1180', '16803', '14951', '672'],\n",
       " ['亚洲', '马尔代夫', '1159', '1883', '717', '7'],\n",
       " ['欧洲', '北马其顿', '1124', '2915', '1640', '151'],\n",
       " ['亚洲', '吉尔吉斯斯坦', '972', '1974', '980', '22'],\n",
       " ['亚洲', '韩国', '951', '11776', '10552', '273'],\n",
       " ['亚洲', '斯里兰卡', '951', '1801', '839', '11'],\n",
       " ['南美洲', '巴拉圭', '878', '1087', '198', '11'],\n",
       " ['非洲', '赤道几内亚', '866', '1043', '165', '12'],\n",
       " ['欧洲', '爱尔兰', '807', '25183', '22698', '1678'],\n",
       " ['非洲', '马达加斯加', '806', '1026', '212', '8'],\n",
       " ['非洲', '毛里塔尼亚', '771', '883', '69', '43'],\n",
       " ['非洲', '乍得', '768', '836', '0', '68'],\n",
       " ['欧洲', '瑞士', '678', '30883', '28545', '1660'],\n",
       " ['欧洲', '塞尔维亚', '678', '12883', '11927', '278'],\n",
       " ['非洲', '塞拉利昂', '677', '929', '205', '47'],\n",
       " ['欧洲', '圣马力诺', '651', '695', '2', '42'],\n",
       " ['非洲', '摩洛哥', '646', '8132', '7278', '208'],\n",
       " ['非洲', '乌干达', '607', '686', '79', '0'],\n",
       " ['欧洲', '拉脱维亚', '593', '1082', '464', '25'],\n",
       " ['南美洲', '法属圭亚那', '588', '589', '0', '1'],\n",
       " ['非洲', '马里', '582', '1485', '816', '87'],\n",
       " ['北美洲', '牙买加', '581', '591', '0', '10'],\n",
       " ['欧洲', '立陶宛', '574', '1694', '1049', '71'],\n",
       " ['欧洲', '爱沙尼亚', '566', '1910', '1275', '69'],\n",
       " ['亚洲', '黎巴嫩', '553', '1312', '731', '28'],\n",
       " ['非洲', '佛得角', '487', '536', '44', '5'],\n",
       " ['欧洲', '波黑', '484', '2610', '1968', '158'],\n",
       " ['欧洲', '阿尔巴尼亚', '484', '1232', '714', '34'],\n",
       " ['非洲', '留尼旺', '479', '480', '0', '1'],\n",
       " ['大洋洲', '澳大利亚', '460', '7255', '6693', '102'],\n",
       " ['非洲', '刚果（布）', '440', '639', '179', '20'],\n",
       " ['亚洲', '塞浦路斯', '430', '960', '504', '26'],\n",
       " ['非洲', '圣多美和普林西比', '378', '458', '68', '12'],\n",
       " ['非洲', '多哥', '365', '485', '107', '13'],\n",
       " ['非洲', '马拉维', '350', '409', '55', '4'],\n",
       " ['亚洲', '也门共和国', '335', '473', '26', '112'],\n",
       " ['欧洲', '安道尔', '329', '852', '472', '51'],\n",
       " ['非洲', '赞比亚共和国', '325', '1111', '779', '7'],\n",
       " ['非洲', '坦桑尼亚', '321', '509', '167', '21'],\n",
       " ['欧洲', '马恩岛', '312', '336', '0', '24'],\n",
       " ['非洲', '斯威士兰', '289', '305', '13', '3'],\n",
       " ['欧洲', '泽西岛', '279', '309', '0', '30'],\n",
       " ['非洲', '贝宁', '274', '339', '62', '3'],\n",
       " ['欧洲', '挪威', '273', '8510', '7999', '238'],\n",
       " ['亚洲', '巴勒斯坦', '261', '643', '377', '5'],\n",
       " ['非洲', '莫桑比克', '252', '352', '98', '2'],\n",
       " ['欧洲', '马耳他', '246', '622', '367', '9'],\n",
       " ['非洲', '卢旺达', '240', '420', '178', '2'],\n",
       " ['欧洲', '根西岛', '239', '252', '0', '13'],\n",
       " ['非洲', '津巴布韦', '228', '265', '33', '4'],\n",
       " ['非洲', '利比里亚', '219', '334', '85', '30'],\n",
       " ['亚洲', '约旦', '204', '784', '571', '9'],\n",
       " ['欧洲', '法罗群岛', '187', '187', '0', '0'],\n",
       " ['北美洲', '马提尼克', '186', '200', '0', '14'],\n",
       " ['非洲', '布基纳法索', '177', '885', '655', '53'],\n",
       " ['欧洲', '直布罗陀', '173', '174', '0', '1'],\n",
       " ['非洲', '尼日尔', '167', '966', '734', '65'],\n",
       " ['亚洲', '蒙古', '167', '191', '24', '0'],\n",
       " ['大洋洲', '关岛', '166', '171', '0', '5'],\n",
       " ['亚洲', '格鲁吉亚', '161', '808', '634', '13'],\n",
       " ['非洲', '利比亚', '159', '239', '75', '5'],\n",
       " ['北美洲', '开曼群岛', '158', '160', '0', '2'],\n",
       " ['北美洲', '瓜德罗普岛', '150', '164', '0', '14'],\n",
       " ['欧洲', '卢森堡', '133', '4032', '3789', '110'],\n",
       " ['北美洲', '百慕大', '132', '141', '0', '9'],\n",
       " ['欧洲', '斯洛伐克', '130', '1526', '1368', '28'],\n",
       " ['亚洲', '中国', '128', '84630', '79857', '4645'],\n",
       " ['其他', '钻石公主号邮轮', '125', '712', '574', '13'],\n",
       " ['欧洲', '克罗地亚', '117', '2247', '2027', '103'],\n",
       " ['南美洲', '圭亚那', '114', '153', '27', '12'],\n",
       " ['南美洲', '乌拉圭', '111', '832', '698', '23'],\n",
       " ['北美洲', '特立尼达和多巴哥', '109', '117', '0', '8'],\n",
       " ['亚洲', '缅甸', '100', '236', '130', '6'],\n",
       " ['北美洲', '阿鲁巴', '98', '101', '0', '3'],\n",
       " ['欧洲', '摩纳哥', '92', '98', '3', '3'],\n",
       " ['北美洲', '巴哈马', '91', '102', '0', '11'],\n",
       " ['大洋洲', '法属波利尼西亚', '89', '89', '0', '0'],\n",
       " ['北美洲', '巴巴多斯', '85', '92', '0', '7'],\n",
       " ['亚洲', '泰国', '82', '3112', '2972', '58'],\n",
       " ['亚洲', '叙利亚', '77', '124', '41', '6'],\n",
       " ['南美洲', '苏里南', '75', '82', '6', '1'],\n",
       " ['非洲', '突尼斯', '74', '1087', '964', '49'],\n",
       " ['欧洲', '斯洛文尼亚', '66', '1509', '1335', '108'],\n",
       " ['非洲', '安哥拉', '65', '86', '17', '4'],\n",
       " ['北美洲', '美属维尔京群岛', '65', '71', '0', '6'],\n",
       " ['北美洲', '荷属圣马丁', '63', '78', '0', '15'],\n",
       " ['亚洲', '越南', '62', '329', '267', '0'],\n",
       " ['非洲', '科摩罗', '60', '62', '0', '2'],\n",
       " ['非洲', '布隆迪共和国', '58', '63', '4', '1'],\n",
       " ['亚洲', '不丹', '48', '48', '0', '0'],\n",
       " ['欧洲', '冰岛', '41', '1806', '1755', '10'],\n",
       " ['非洲', '博茨瓦纳', '39', '40', '0', '1'],\n",
       " ['北美洲', '圣马丁岛', '38', '41', '0', '3'],\n",
       " ['欧洲', '列支敦士登', '27', '83', '55', '1'],\n",
       " ['北美洲', '圣文森特和格林纳丁斯', '26', '26', '0', '0'],\n",
       " ['大洋洲', '北马里亚纳群岛联邦', '24', '26', '0', '2'],\n",
       " ['亚洲', '东帝汶', '24', '24', '0', '0'],\n",
       " ['非洲', '冈比亚', '23', '26', '2', '1'],\n",
       " ['北美洲', '格林那达', '23', '23', '0', '0'],\n",
       " ['非洲', '纳米比亚', '22', '25', '3', '0'],\n",
       " ['北美洲', '安提瓜和巴布达', '22', '25', '0', '3'],\n",
       " ['北美洲', '库拉索岛', '20', '21', '0', '1'],\n",
       " ['大洋洲', '新喀里多尼亚', '20', '20', '0', '0'],\n",
       " ['北美洲', '圣卢西亚', '19', '19', '0', '0'],\n",
       " ['亚洲', '老挝', '19', '19', '0', '0'],\n",
       " ['大洋洲', '斐济', '18', '18', '0', '0'],\n",
       " ['北美洲', '伯利兹', '16', '18', '0', '2'],\n",
       " ['北美洲', '多米尼克', '16', '16', '0', '0'],\n",
       " ['北美洲', '圣其茨和尼维斯', '15', '15', '0', '0'],\n",
       " ['北美洲', '格陵兰', '13', '13', '0', '0'],\n",
       " ['南美洲', '福克兰群岛', '13', '13', '0', '0'],\n",
       " ['欧洲', '梵蒂冈', '12', '12', '0', '0'],\n",
       " ['北美洲', '特克斯和凯科斯群岛', '11', '12', '0', '1'],\n",
       " ['非洲', '塞舌尔', '11', '11', '0', '0'],\n",
       " ['北美洲', '蒙特塞拉特', '10', '11', '0', '1'],\n",
       " ['亚洲', '文莱', '8', '141', '131', '2'],\n",
       " ['大洋洲', '巴布亚新几内亚', '8', '8', '0', '0'],\n",
       " ['北美洲', '英属维尔京群岛', '7', '8', '0', '1'],\n",
       " ['南美洲', '荷兰加勒比地区', '7', '7', '0', '0'],\n",
       " ['北美洲', '圣巴泰勒米岛', '6', '6', '0', '0'],\n",
       " ['非洲', '毛里求斯', '5', '337', '322', '10'],\n",
       " ['非洲', '莱索托', '4', '4', '0', '0'],\n",
       " ['亚洲', '柬埔寨', '3', '125', '122', '0'],\n",
       " ['北美洲', '安圭拉', '3', '3', '0', '0'],\n",
       " ['非洲', '厄立特里亚', '2', '41', '39', '0'],\n",
       " ['北美洲', '圣皮埃尔和密克隆群岛', '1', '1', '0', '0'],\n",
       " ['欧洲', '黑山', '0', '324', '315', '9'],\n",
       " ['大洋洲', '新西兰', '-215', '1154', '1347', '22']]"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "temp1 = text_global.split(\"\\n\")\n",
    "temp_global =[]\n",
    "for i in temp1:\n",
    "    temp_global.append(i.split())\n",
    "temp_global"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>大陆</th>\n",
       "      <th>国家</th>\n",
       "      <th>现存确诊</th>\n",
       "      <th>累计确诊</th>\n",
       "      <th>治愈</th>\n",
       "      <th>死亡</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>北美洲</td>\n",
       "      <td>美国</td>\n",
       "      <td>1309892</td>\n",
       "      <td>1920552</td>\n",
       "      <td>500849</td>\n",
       "      <td>109811</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>南美洲</td>\n",
       "      <td>巴西</td>\n",
       "      <td>338366</td>\n",
       "      <td>676494</td>\n",
       "      <td>302084</td>\n",
       "      <td>36044</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>欧洲</td>\n",
       "      <td>英国</td>\n",
       "      <td>243864</td>\n",
       "      <td>284868</td>\n",
       "      <td>539</td>\n",
       "      <td>40465</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>欧洲</td>\n",
       "      <td>俄罗斯</td>\n",
       "      <td>235083</td>\n",
       "      <td>467673</td>\n",
       "      <td>226731</td>\n",
       "      <td>5859</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>亚洲</td>\n",
       "      <td>印度</td>\n",
       "      <td>120406</td>\n",
       "      <td>246628</td>\n",
       "      <td>119293</td>\n",
       "      <td>6929</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>210</th>\n",
       "      <td>北美洲</td>\n",
       "      <td>安圭拉</td>\n",
       "      <td>3</td>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>211</th>\n",
       "      <td>非洲</td>\n",
       "      <td>厄立特里亚</td>\n",
       "      <td>2</td>\n",
       "      <td>41</td>\n",
       "      <td>39</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>212</th>\n",
       "      <td>北美洲</td>\n",
       "      <td>圣皮埃尔和密克隆群岛</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>213</th>\n",
       "      <td>欧洲</td>\n",
       "      <td>黑山</td>\n",
       "      <td>0</td>\n",
       "      <td>324</td>\n",
       "      <td>315</td>\n",
       "      <td>9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>214</th>\n",
       "      <td>大洋洲</td>\n",
       "      <td>新西兰</td>\n",
       "      <td>-215</td>\n",
       "      <td>1154</td>\n",
       "      <td>1347</td>\n",
       "      <td>22</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>215 rows × 6 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "      大陆          国家     现存确诊     累计确诊      治愈      死亡\n",
       "0    北美洲          美国  1309892  1920552  500849  109811\n",
       "1    南美洲          巴西   338366   676494  302084   36044\n",
       "2     欧洲          英国   243864   284868     539   40465\n",
       "3     欧洲         俄罗斯   235083   467673  226731    5859\n",
       "4     亚洲          印度   120406   246628  119293    6929\n",
       "..   ...         ...      ...      ...     ...     ...\n",
       "210  北美洲         安圭拉        3        3       0       0\n",
       "211   非洲       厄立特里亚        2       41      39       0\n",
       "212  北美洲  圣皮埃尔和密克隆群岛        1        1       0       0\n",
       "213   欧洲          黑山        0      324     315       9\n",
       "214  大洋洲         新西兰     -215     1154    1347      22\n",
       "\n",
       "[215 rows x 6 columns]"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Global=pd.DataFrame(temp_global,columns = [\"大陆\",'国家','现存确诊','累计确诊','治愈','死亡'] )\n",
    "Global"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 存储进入数据库"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [],
   "source": [
    "# import sqlite3\n",
    "\n",
    "# query = \"\"\"\n",
    "#         CREATE TABLE test\n",
    "#         (a VARCHAR(20), b VARCHAR(20),\n",
    "#         c REAL, d INTEGER);\n",
    "# \"\"\"\n",
    "\n",
    "# con = sqlite3.connect(\"test.db\")\n",
    "# print(con.execute(query))\n",
    "# con.commit()\n",
    "# # 使用SQL INSERT语句插入数据\n",
    "\n",
    "# data = [('white', 'up', 1, 3),\n",
    "#         ('black', 'down', 2, 8),\n",
    "#         ('green', 'up', 4, 4),\n",
    "#         ('red', 'down', 5, 5)]\n",
    "# stmt = \"INSERT INTO test VALUES(?,?,?,?)\"\n",
    "# print(con.executemany(stmt, data))\n",
    "# con.commit()\n",
    "# print(data)\n",
    "\n",
    "#这种方式写入数据库太低端了"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "* 来个高级一点的 Sqlalchemy"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "from sqlalchemy import create_engine\n",
    "#利用pandas自带的和sqlite交互包，方便快捷\n",
    "engine= create_engine('sqlite:///test.db')\n",
    "China.to_sql('China', engine,if_exists='replace',index = False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [],
   "source": [
    "#利用pandas自带的和sqlite交互包，方便快捷\n",
    "Global.to_sql('Global', engine,if_exists='replace',index = False)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### China数据已经写入数据库，看下图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<img src='China.png', width=80%>\n"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "%%html\n",
    "<img src='China.png', width=80%>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Global也在这儿"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<img src='Global.png', width=80%>\n"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "%%html\n",
    "<img src='Global.png', width=80%>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 可视化展示\n",
    "* 代码中有实现，结果在文件夹中的HTML文件，可用浏览器查看"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 体温管理系统"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "* 也只是简单的实现"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<img src='个人体温.png', width=80%>\n"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "%%html\n",
    "<img src='个人体温.png', width=80%>\n",
    "#里面的数据都是可以直接点击修改的，\n",
    "#使用前点击查看所有，才会显示人员信息，删除所有需要超管权限（注意与管理员权限不同），超管（超级管理员）就是作者我啦\n",
    "# 添加用户管理都是可以的，但是管理员不能干涉其他管理员，超管可以随时删除管理员，超管密码在数据库admin中存储（已经hash加密过）\n",
    "# 可以尝试破解一下"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 总结\n",
    "* 数据库作用在各方各面结合的还是比较多的\n",
    "* 第一次尝试pandas结合数据库做数据分析\n",
    "* 第一次尝试做图形界面，虽然做的不美观，但是还能将就用，程序里面还有不少未解决的小bug，\n",
    "* 能解决的作者都尝试都解决了，剩下的80%应该都能靠重启解决了"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
